package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.FirstMinnerFindHomeInfoBean;
import com.lianzhihui.romeex.bean.FirstMinnerFindRecordInfoBean;
import com.lianzhihui.romeex.mvp.model.BaiZhanTingModelImp;
import com.lianzhihui.romeex.mvp.model.BaiZhanTingModelInterface;
import com.lianzhihui.romeex.mvp.model.BindRomeexModelImp;
import com.lianzhihui.romeex.mvp.model.BindRomeexModelInterface;
import com.lianzhihui.romeex.mvp.view.BaiZhanTingView;
import com.lianzhihui.romeex.mvp.view.BindRomeexView;

//逻辑实现
public class BaiZhanTingPresnterImp implements BaiZhanTingModelInterface {

    private final BaiZhanTingView viewLayer;
    private final BaiZhanTingModelImp modelImp;

    public BaiZhanTingPresnterImp(Context context, BaiZhanTingView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new BaiZhanTingModelImp(context, this);
    }

    public void requestFirstMinnerFindhome() {
        modelImp.requestFirstMinnerFindhome();
    }

    public void requestFirstMinnerFindrecord(int page, int pageSize) {
        modelImp.requestFirstMinnerFindrecord(page, pageSize);
    }

    public void requestFirstMinnerOpenFirstStatus() {
        modelImp.requestFirstMinnerOpenFirstStatus();
    }


    @Override
    public void responseSuccess() {
        viewLayer.success();
    }

    /**
     * 头矿首页
     * @param bean
     */
    @Override
    public void responseFirstMinnerFindhomeSuccess(FirstMinnerFindHomeInfoBean bean) {
        viewLayer.firstMinnerFindhomeSuccess(bean);
    }

    /**
     * 头矿挖矿记录
     * @param bean
     */
    @Override
    public void responseFirstMinnerFindrecordSuccess(FirstMinnerFindRecordInfoBean bean) {
        viewLayer.firstMinnerFindrecordSuccess(bean);
    }


    @Override
    public void onFailure() {
        viewLayer.setFailure();
    }
}
